<template>
  <el-dialog
    title="提示"
    :visible="dialogVisible"
    width="30%"
    class="eldialog"
  >
    <i class="el-icon-warning"></i>
    <span>此操作将永久删除该标签, 是否继续?</span>
    <el-row style="text-align: right">
      <el-button  size="mini">取消</el-button>
      <el-button type="primary" size="mini" @click="btnOK">确 定</el-button>
    </el-row>
  </el-dialog>
</template>
<script>
import { remove as removeTag } from '@/api/hmmm/tags'
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      required: true
    },
    id: {
      type: Object,
      required: true
    }
  },
  methods: {
    async btnOK () {
      try {
        console.log(this.id)
        await removeTag(this.id)
        this.$message.success('删除成功')
        this.$emit('update:dialogVisible', false)
        // 重新拉取数据
        this.$emit('loadTagList')
      } catch (err) {
        console.log(err)
      }
    }

  }
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog__header {
  background-color: #fff;
  span {
    color: #000;
  }
}
.el-icon-warning {
  color: #e6a23c;
  font-size: 20px;
  padding-right: 10px;
}
::v-deep .el-dialog__body {
  padding: 10px;
}
</style>
